<div class="md-header__option">
    <div class="md-select">
      {% set icon = config.theme.icon.alternate or "material/translate" %}
      <button class="md-header__button md-icon" aria-label="??">
        {% include ".icons/" ~ icon ~ ".svg" %}
      </button>
      <div class="md-select__inner">
        <ul class="md-select__list">
          {% for lang in config.extra.alternate -%}
            <li class="md-select__item">
              {% set segments = page.url.split('/') %}
              {% set site_url = config.site_url.rstrip('/') %}
              <a href="{{ site_url }}/{{ segments[0:2]|join('/') }}/{{ lang.lang }}/{{ segments[3:]|join('/') }}" hreflang="{{ lang.lang }}" class="md-select__link">
                {{ lang.name }}
              </a>
            </li>
          {% endfor %}
        </ul>
      </div>
    </div>
  </div>
